package distrcomp;

import java.io.InputStream;
import java.rmi.AlreadyBoundException;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

import javax.rmi.ssl.SslRMIClientSocketFactory;
import javax.rmi.ssl.SslRMIServerSocketFactory;

/*
 * Server class
 */

public class Reg {
	public static void main(String[] args) throws RemoteException, AlreadyBoundException {
		RegistryImpl r = new RegistryImpl();
		
		LocateRegistry.createRegistry(1099, new SslRMIClientSocketFactory(), new SslRMIServerSocketFactory(null, null, true));
		Registry registry = LocateRegistry.getRegistry(null, 1099, new SslRMIClientSocketFactory());
		registry.bind("Registry", r);
	}
}
